Title: Year 12 / Computer Science / Practical / 10 - Data types and structures / 10.2 - Arrays

Q: Describe what is meant by the "index" of an array
A: numerical indicator of an item of data's position in an array

Q: Describe what is meant by the "lower bound" of an array
A: index of the first element in an array, usually 0 or 1

Q: Describe what is meant by the "upper bound" of an array
A: index of the last element in an array

Q: Describe what is meant by a "2D array"
A: where an element in an array is an array itself

Q: Write the pseudocode for declaring a 1D array
A: DECLARE <identifier> : ARRAY[<l>:<u>] OF <data type>

Q: Write the pseudocode for declaring a 2D array
A: DECLARE <identifier> : ARRAY[<l1>:<u1>, <l2>:<u2>] OF <data type>

Q: Write the pseudocode for adding an element "Ali" to a 1D array at index i
A: <identifier>[i] <- "Ali"

Q: Write the pseudocode for adding an element "Ali" to a 2D array at index 1 of the first array
A: <identifier>[0][1] <- "Ali"

Q: Explain what is meant by a bubble sort
A: a simple sorting algorithm
compares each pair of adjacent values
elements are swapped if they are not in order
keeps looping until everything is in order